import request from '@/utils/request'

export function GetPsProduct(data) {
  return request({
    url: '/erp/api/prestashop_api_get_product/',
    headers: { 'content-type': 'application/json' },
    method: 'post',
    data: data,
    timeout: 90000
  })
}

export function EnableCountries(id, args) {
  return request({
    url: `/erp/api/prestashop_api_enable_countries/${id || ''}${args && ('?' + args) || ''}`,
    method: 'get'
  })
}

export function CleanCache(id, args) {
  return request({
    url: `/erp/api/cleancache/${id || ''}${args && ('?' + args) || ''}`,
    method: 'get'
  })
}

export function FixAttributes(args) {
  return request({
    url: `/erp/api/fixattributes/`,
    headers: { 'content-type': 'application/json' },
    method: 'post',
    timeout: 100000,
    data: args
  })
}

export function DeleteAttribute(args) {
  return request({
    url: `/erp/api/delete_attribute/`,
    headers: { 'content-type': 'application/json' },
    method: 'post',
    timeout: 100000,
    data: args
  })
}

export function MoidfyMultiPrice(args) {
  return request({
    url: `/erp/api/modify_multi_price/`,
    headers: { 'content-type': 'application/json' },
    method: 'post',
    timeout: 100000,
    data: args
  })
}

export function ModifyPsProductWeight(args) {
  return request({
    url: `/erp/api/modify_ps_product_weight/`,
    headers: { 'content-type': 'application/json' },
    method: 'post',
    timeout: 100000,
    data: args
  })
}

export function GetPsProductWeight(args) {
  return request({
    url: `/erp/api/get_ps_product_weight/`,
    headers: { 'content-type': 'application/json' },
    method: 'post',
    timeout: 100000,
    data: args
  })
}

export function AddPsAttrubute(args) {
  return request({
    url: `/erp/api/prestashop_api_add_product_attribute/`,
    headers: { 'content-type': 'application/json' },
    method: 'post',
    timeout: 100000,
    data: args
  })
}

export function ModifyPsAttributeName(args) {
  return request({
    url: `/erp/api/prestashop_api_modify_attribute_name/`,
    headers: { 'content-type': 'application/json' },
    method: 'post',
    timeout: 100000,
    data: args
  })
}

export function SetCombinationImage(args) {
  return request({
    url: `/erp/api/prestashop_api_set_combination_image/`,
    headers: { 'content-type': 'application/json' },
    method: 'post',
    timeout: 100000,
    data: args
  })
}

export function ChangeStartOrderNumber(args) {
  return request({
    url: `/erp/api/prestashop_api_set_start_order_number/`,
    headers: { 'content-type': 'application/json' },
    method: 'post',
    timeout: 100000,
    data: args
  })
}

export function modify_ps_wk_product_field(args) {
  return request({
    url: `/erp/api/modify_ps_wk_product_field/`,
    headers: { 'content-type': 'application/json' },
    method: 'post',
    timeout: 100000,
    data: args
  })
}
